{% load static tailwind_tags %}
<!doctype html>

<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
{#        <script src="https://cdn.tailwindcss.com"></script>#}
        <title>{% block title %}{% endblock %} | MyShop</title>
        {% tailwind_css %}
        <link href="{% static 'fontawesomefree/css/all.min.css' %}" rel="stylesheet" type="text/css">
    </head>

    <body>
        <nav class="py-6 px-6 flex justify-between items-center border-b border-gray-200">
            <a href="/" class="text-xl font-semibold">MyShop</a>

            <div class="space-x-6">
                {% if request.user.is_authenticated %}
                <a href="{% url 'item:new' %}"
                   class="text-lg font-semibold hover:text-gray-500">添加商品</a>
                {% endif %}
                <a href="{% url 'item:items' %}"
                   class="text-lg font-semibold hover:text-gray-500">浏览</a>
                {% if request.user.is_authenticated %}
                <a href="{% url 'dashboard' %}"
                   class="text-lg font-semibold hover:text-gray-500">我的商品</a>                           <a href="{% url 'order_list' %}"
                   class="text-lg font-semibold hover:text-gray-500">我的订单</a>                            <a href="{% url 'cart_detail' %}"
                   class="text-lg font-semibold hover:text-gray-500"><i class="fa-solid fa-cart-shopping"></i> 购物车</a>
                <a href="{% url 'conversation:inbox' %}"
                   class="text-lg font-semibold hover:text-gray-500"><i class="fa-regular fa-envelope"></i> Inbox</a>
                {% if request.user.is_staff %}
                <a href="/admin/"
                   class="text-lg font-semibold hover:text-gray-500"><i class="fa-solid fa-gear"></i> 后台管理</a>
                {% endif %}
                <a href="{% url 'shop:logout' %}"
                   class="px-6 py-3 text-lg font-semibold bg-teal-500 text-white rounded-xl hover:bg-teal-700">登出</a>
                {% else %}
                <a href="{% url 'shop:signup' %}"
                   class="px-6 py-3 text-lg font-semibold bg-teal-500 text-white rounded-xl hover:bg-teal-700">注册</a>
                <a href="{% url 'shop:login' %}"
                   class="px-6 py-3 text-lg font-semibold bg-gray-500 text-white rounded-xl hover:bg-gray-700">登录</a>
                {% endif %}
            </div>
        </nav>

        <div class="px-6 py-6">
            {% block content %}
            {% endblock %}
        </div>

        <footer class="py-6 px-6 flex justify-between bg-gray-800">
            <div class="w-2/3 pr-10">
                <h3 class="mb-5 font-semibold text-gray-400">MyShop</h3>

                <p class="text-lg text-gray-500">来买卖你的宝贝商品</p>
            </div>

            <div class="w-1/3">
                <h3 class="mb-5 font-semibold text-gray-400">其他信息</h3>

                <ul class="space-y-2">
                    <li><a href="#" class="text-lg text-teal-500 hover:text-teal-700">关于网站</a></li>
                    <li><a href="#" class="text-lg text-teal-500 hover:text-teal-700">联系我们</a></li>
                    <li><a href="#" class="text-lg text-teal-500 hover:text-teal-700">使用协议</a></li>
                </ul>
            </div>
        </footer>
        <script src="{% static 'fontawesomefree/js/all.min.js' %}"></script>
    </body>
</html>
